<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>提醒统计</title>
    <link rel="stylesheet" href="/layui/css/layui.css">
    <link rel="stylesheet" href="/css/custom.form.css">
    <style type="text/css">
        .layui-disabled, .layui-disabled:hover {
            color: #000000 !important;
            cursor: not-allowed !important;
        }

        .layui-form-label {
            width: 100px;
        }

        .layui-input-block {
            margin-left: 130px;
        }

        .layui-input layui-unselect {
            cursor: pointer;
        }

        .layui-table {
            width: 96%;
        }
    </style>
</head>
<body>

<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-header"></div>
                <div class="layui-card-body">
                    <div class="panel panel-default operation" hidden>
                        <div class="panel-heading title"></div>
                        <div class="layui-tab">
                            <div class="layui-tab-content">
                                <div class="layui-tab-item layui-show">
                                    <div class="layui-card-body">
                                        <form class="layui-form" action="" lay-filter="info">
                                            <input name="_tabKey" id="_tabKey" hidden>
                                            <input name="_jcajxxuuid" id="_jcajxxuuid" hidden>

                                            <fieldset class="layui-elem-field layui-field-title" style="margin-top: 10px;">
                                                <legend>案件信息</legend>
                                            </fieldset>

                                            <div class="layui-form-item">
                                                <label class="layui-form-label">案件名称</label>
                                                <div class="layui-input-inline">
                                                    <input type="text" id="ajmc" name="ajmc"
                                                           class="layui-input layui-disabled" disabled="ture">
                                                </div>

                                                <label class="layui-form-label">检查项目</label>
                                                <div class="layui-input-inline">
                                                    <input type="text" id="jcxm" name="jcxm"
                                                           class="layui-input layui-disabled" disabled="ture">
                                                </div>
                                            </div>
                                            <div class="layui-form-item">
                                                <label class="layui-form-label">检查人</label>
                                                <div class="layui-input-inline">
                                                    <input type="text" id="jcry" name="jcry"
                                                           class="layui-input layui-disabled" disabled="ture">
                                                </div>
                                            </div>
                                            <div class="layui-form-item">
                                                <label class="layui-form-label">纳税人名称</label>
                                                <div class="layui-input-inline">
                                                    <input type="text" id="nsrmc" name="nsrmc"
                                                           class="layui-input layui-disabled" disabled="ture">
                                                </div>
                                                <label class="layui-form-label">纳税人识别号</label>
                                                <div class="layui-input-inline">
                                                    <input type="text" id="nsrsbh" name="nsrsbh"
                                                           class="layui-input layui-disabled" disabled="ture">
                                                </div>
                                            </div>

                                            <fieldset class="layui-elem-field layui-field-title" style="margin-top: 10px;">
                                                <legend>提醒点</legend>
                                            </fieldset>

                                            <div class="layui-form-item">
                                                <label class="layui-form-label">提醒点</label>
                                                <div class="layui-input-block">
									<textarea rows="3" name="fk" id="fk"
                                              placeholder="" autocomplete="off"
                                              class="layui-textarea layui-disabled"
                                              disabled="ture">金税三期两书未出具</textarea>
                                                </div>
                                            </div>

                                            <!-- <div class="layui-form-item">
                                                <div class="layui-input-block">
                                                    <button class="layui-btn layui-btn-primary" id="btn_cancel">返回</button>
                                                </div>
                                            </div> -->
                                        </form>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="layui-tab table_div">

                        <div class="layui-tab-content">

                            <div id="showTableDiv">
                                <div class="layui-form-item">

                                </div>
                                <table class="layui-table" id="showTable" lay-filter="showTable"></table>
                            </div>


                            <div id="showTableDiv1" hidden>
                                <div class="layui-form-item">
                                    <div class="layui-input-block">
                                        <button class="layui-btn layui-btn-primary" onclick="back()">返回</button>
                                    </div>
                                </div>
                                <table class="layui-table" id="showTable1" lay-filter="showTable1"></table>
                            </div>

                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<script type="text/html" id="tool">
    <a class="layui-btn layui-btn-xs" lay-event="view">详情</a>
</script>

<script src="/layui/layui.all.js"></script>
<script src="/js/core.util.js"></script>
<script th:inline="none">
    // 获取token
    var token = CoreUtil.getData("access_token");
    // 地址栏转义token中的#号
    var tokenQuery = token.replace("#", "%23");
    var showTable1;
    var showTable;
    var table = layui.table;
    var form = layui.form;
    var layer = layui.layer;
    var $ = jQuery = layui.jquery;
    var laydate = layui.laydate;
    var upload = layui.upload;
    var element = layui.element;
    var maxlength = 500;
    var inspectionMan = "";
    var mold = "";
    var contentdate = null;
    layui.use(['table', 'layer', 'laydate', 'upload', 'element'], function () {
        // 未读
        showTable = table.render({
            elem: '#showTable',
            contentType: 'application/json',
            headers: {
                "authorization": token
            },
            page: true // 开启分页
            ,
            url: '/workflow/risk1/directorGeneral' //数据接口
            ,
            method: 'POST',
            parseData: function (res) { //将原始数据解析成 table 组件所规定的数据
                return {
                    "code": res.code, //解析接口状态
                    "msg": res.msg, //解析提示文本
                    "count": CoreUtil.isEmpty(res.data) ? 0 : res.data.total, //解析数据长度
                    "data": CoreUtil.isEmpty(res.data) ? null
                        : CoreUtil.paramsDecrypt(res.data.records)
                }
            },

            cols: [[
                {
                    align: 'center',
                    width: 158,
                    field: 'taxorgcode',
                    title: '税务机关代码',
                    sort: true,
                }, {
                    align: 'center',
                    width: 660,
                    field: 'swjg_dm',
                    title: '税务机关名称',
                    sort: true,
                }, {
                    align: 'center',
                    width: 207,
                    field: 'count',
                    title: '提醒数量',
                    sort: true,
                }, {
                    fixed: 'right',
                    align: 'center',
                    width: 95,
                    toolbar: "#tool",
                    title: '操作'
                }
            ]],
            toolbar: '#logToolbar'
        });

        // 列操作
        table.on('tool(showTable)', function (obj) {
            var data = obj.data;
            switch (obj.event) {
                case 'view':
                    search1(data.taxorgcode);
                    $("#showTableDiv").hide();
                    $("#showTableDiv1").show();
                    break;
            }
        });

        showTable1 = table.render({
            elem: '#showTable1',
            contentType: 'application/json',
            headers: {
                "authorization": token
            },
            page: true // 开启分页
            ,
            url: '/workflow/risk1/sectionChief' //数据接口
            ,
            method: 'POST',
            parseData: function (res) { //将原始数据解析成 table 组件所规定的数据
                return {
                    "code": res.code, //解析接口状态
                    "msg": res.msg, //解析提示文本
                    "count": CoreUtil.isEmpty(res.data) ? 0 : res.data.total, //解析数据长度
                    "data": CoreUtil.isEmpty(res.data) ? null
                        : CoreUtil.paramsDecrypt(res.data.records)
                }
            },

            cols: [[
                {
                    align: 'center',
                    width: 230,
                    field: 'id',
                    title: '提醒编号',
                    hide: true,
                    sort: true,
                }, {
                    align: 'center',
                    width: 200,
                    field: 'ajbh',
                    title: '案件编号',
                    sort: true,
                }, {
                    align: 'center',
                    width: 180,
                    field: 'riskMan1',
                    title: '提醒人',
                    sort: true,
                }, {
                    align: 'center',
                    width: 180,
                    field: 'riskRead1',
                    title: '是否已读',
                    sort: true,
                }, {
                    align: 'center',
                    width: 180,
                    field: 'riskName',
                    title: '提醒名称',
                    sort: true,
                }, {
                    align: 'center',
                    width: 600,
                    field: 'details',
                    title: '提醒详情',
                    sort: true,
                },
                {
                    field: 'createTime',
                    title: '提醒日期',
                    width: 160,
                    align: "center",
                    sort: true,
                    templet: function (d) {
                        if (!d.createTime) {
                            return '';
                        }
                        return layui.util.toDateString(d.createTime, 'yyyy-MM-dd');
                    }
                },
            ]],
            toolbar: '#logToolbar'
        });

        // 返回
        $("#btn_cancel").click(function () {
            back();
            return false;
        });

    });

    function search() {
        showTable.reload({
            where: {},
            page: {
                curr: 1
            }
        });
    }

    function search1(_taxorgcode) {
        showTable1.reload({
            where: {
                taxorgcode: _taxorgcode
            },
            page: {
                curr: 1
            }
        });
    }

    function view(data, id) {
        var _taxorgcode = data.taxorgcode;
    }


    function back() {
        search();
        $("#showTableDiv1").hide();
        $("#showTableDiv").show();
    }

</script>

</body>
</html>